﻿Public Class ScenePage
    Inherits UIElementBase

    Public Property Container() As New List(Of UIElementBase)

    Public Sub New(ByVal g As Game)
        MyBase.New(g)
    End Sub

    Public Sub New(ByVal g As Game, ByVal name As String)
        MyBase.New(name, g)
    End Sub

    Public Overloads Overrides Sub Draw(gameTime As GameTime)
        Try
            Me.Container.Sort(Function(a, b) a.DrawOrder - b.DrawOrder)
            For Each ctrl In Me.Container
                ctrl.Draw(gameTime)
            Next
        Catch ex As Exception
            Throw ex
        End Try
    End Sub

End Class